package com.orhon.smartcampus.modules.material.mm;



import java.util.List;

import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import com.orhon.smartcampus.modules.base.mm.LangMapper;
import com.orhon.smartcampus.modules.base.mm.SchoolMapper;
import com.orhon.smartcampus.modules.material.entity.Buildings;
import com.orhon.smartcampus.modules.material.gqlModel.GQLBuilding;

@Mapper(
		uses = {
				LangMapper.class,
				SchoolMapper.class

		}
		)
public interface BuildingMapper {


	BuildingMapper MAPPER = Mappers.getMapper(BuildingMapper.class);

	@Mapping(source = "id" , target = "id")
	@Mapping(source = "buildingsCode" , target = "code")
	@Mapping(source = "unitNum" , target = "unit_num")
	@Mapping(source = "floorNum" , target = "floor_num")
	@Mapping(source = "buildingsStatus" , target = "status")
	@Mapping(source = "buildingsAt" , target = "build_at")
	@Mapping(source = "buildingsYears" , target = "years")
	@Mapping(source = "buildingsTel" , target = "tel")
	@Mapping(source = "buildingsUse" , target = "purpose")
	@Mapping(source = "buildingsCost" , target = "cost")
	@Mapping(source = "buildingsArea" , target = "area")
	@Mapping(source = "buildingsOnarea" , target = "occupied_area")
	@Mapping(source = "buildingsName" , target = "name")
	@Mapping(source = "buildingsProperty" , target = "property")
	@Mapping(source = "buildingsMaterial" , target = "material")
	@Mapping(source = "bulidingsIntroduction" , target = "intro")
	@Mapping(ignore = true, target = "campus" )
	//@Mapping(ignore = true, target = "site" )
	//@Mapping(ignore = true, target = "school" )
	GQLBuilding toBuilding(Buildings entity);

	@InheritConfiguration(name = "toBuilding")
	List<GQLBuilding> toGQLBuildingList(List<Buildings> entities);
}
